home *** CD-ROM | disk | FTP | other *** search
/ Complete Internet Archive / Complete Internet Archive.iso / Web Boards / WebForum_tar(2).Z / WebForum_tar(2) / WebForum / Makefile next >
Encoding:
Makefile  |  1995-01-23  |  11.7 KB  |  446 lines

  1. ############################################################
  2. # Makefile for the WebForum WWW package
  3.  
  4. ############################################################
  5. #
  6. # Configuration: Please Note that many of these are "sed"
  7. #          replaced into scripts using ^ as the
  8. #         separator character. If you wish to use ^
  9. #         in your name, for example, you must escape
  10. #         it, i.e., \^
  11. #
  12. ############################################################
  13.  
  14. # Creator - you
  15. CREATOR=<a href=mailto:afzal\\@divsun.unige.ch>Afzal Ballim</a>
  16.  
  17. #your email address
  18. CREADDR=afzal\\@divsun.unige.ch, petitp\\@divsun.unige.ch
  19.  
  20. #Your server's type: currently only NCSA httpd is supported
  21. SERVER_TYPE=NCSAhttpd
  22.  
  23. # Your server's url, don't forget that trailing /
  24. SERVER_NAME=http://issco-www.unige.ch/
  25.  
  26. ###############################################################
  27. # Physcial roots that are used by the makefile and some scripts
  28.  
  29. # Absolute WWW root: the complete path of the WWW root on your server
  30. AbsWWWRoot=/home/isscowww/www
  31.  
  32. # Absolute cgi-bin path
  33. AbsCGIBin=/home/isscowww/httpd/cgi-bin
  34.  
  35. #Url path to the base bin directory
  36. UrlBin=/cgi-bin
  37.  
  38. #The name of the subdirectory for the WebForum package
  39. WebForumBase=WebForum
  40.  
  41. # The name of a directory where outgoing mail is queued for handling
  42. MAILQUEUE=/home/isscowww/out_queue
  43.  
  44. ############################################################
  45. # locations of programs
  46.  
  47. Perl=/usr/local/bin/perl5
  48.  
  49. sed=/usr/local/bin/sed
  50.  
  51. # Your command that sends mail from a file
  52. # The command should not require command-line arguments
  53. # for subject and "to"
  54. sendmail=/usr/local/bin/sendean
  55.  
  56. ############################################################
  57. #
  58. # logging facilities
  59.  
  60. LogFile=/home/isscowww/in_queue/WFLog
  61.  
  62. # LogLevel: 0 = no logging
  63. #         1 = only at top level
  64. #        2 = all commands
  65. LogLevel=2
  66.  
  67. ############################################################
  68. ############################################################
  69. #
  70. # End configuration - do not change anything below this line
  71. #        Any changes below are at your peril
  72. #
  73. # The only place where you might want to make changes is
  74. # under access control if you do not use the standard names
  75. # for NCCSA httpd access control (.htaccess, etc.)
  76. #
  77. ############################################################
  78. ############################################################
  79.  
  80. ############################################################
  81. #
  82. # DERIVED VARIABLES
  83.  
  84. # and the subdirectory for this package
  85. AbsWFRoot=$(AbsWWWRoot)/$(WebForumBase)
  86.  
  87. # cgi path for this package
  88. AbsWFBin=$(AbsCGIBin)/$(WebForumBase)
  89.  
  90. AbsWFCtrlBin=$(AbsWFBin)/ctrl
  91. AbsWFAdminBin=$(AbsWFBin)/admin
  92.     
  93. #Complete URL
  94. UrlWFComplete=$(SERVER_NAME)$(WebForumBase)/
  95.  
  96. # URL WWW root: Where the index, registry, and messages go
  97. UrlWFRoot=/$(WebForumBase)
  98.  
  99. # URL for script bin for this package
  100. UrlWFBin=$(UrlBin)/$(WebForumBase)
  101.  
  102. UrlWFCtrlBin=$(UrlWFBin)/ctrl
  103. UrlWFAdminBin=$(UrlWFBin)/admin
  104.  
  105. DATE:sh=date
  106.  
  107. AbsWFDbase=$(AbsWFRoot)/.dbase
  108. AbsWFSpool=$(AbsWFRoot)/.spool
  109. AbsWFHtml=$(AbsWFRoot)/.html
  110.  
  111. Directories=$(AbsWFRoot)\
  112.     $(AbsWFDbase) $(AbsWFDbase)/guest $(AbsWFDbase)/wfroot \
  113.     $(AbsWFSpool) $(AbsWFHtml)\
  114.     $(AbsWFBin) $(AbsWFCtrlBin) $(AbsWFAdminBin)
  115.  
  116. ############################################################
  117. #
  118. # script and html page names: used in sed script replacements
  119. # as well as in some target/dependencies of the Makefile
  120. #
  121. # When you change things here, don't forget to change the sed
  122. # section as well.
  123.  
  124. LIBWEBFORUM.PL=libWebForum.pl
  125. TOP.PL=top.pl
  126. FORUM.PL=forum.pl
  127. SUBJECT.PL=subject.pl
  128. REGISTER.PL=register.pl
  129. POST.PL=post.pl
  130. MKMSG.PL=mkmsg.pl
  131. CANCEL.PL=cancel.pl
  132. WFCOMMAND.PL=wfcommand.pl
  133.  
  134. TESTCOMMAND.PL=interfacecom.pl
  135. SMAIL.PL=SMail.pl
  136.  
  137. ADMIN.PL=adm_command.pl
  138. ADSHOWUSERS.PL=adm_showusers.pl
  139. ADADDFORUM.PL=adm_adforum.pl
  140. ADAGRP.PL=adm_adgrp.pl
  141. ADAUS.PL=adm_aduser.pl
  142. ADSNR.PL=adm_shownreg.pl
  143. ADUNR.PL=adm_updus.pl
  144. ADDLF.PL=adm_delf.pl
  145. ADDGRP.PL=adm_delgrp.pl
  146. ADDLU.PL=adm_delu.pl
  147. ADSGRP.PL=adm_showgroups.pl
  148. ADGMU.PL=adm_grpmu.pl
  149. ADGPU.PL=adm_grppu.pl
  150. ADSFG.PL=adm_showfg.pl
  151. ADFPG.PL=adm_fmpgrp.pl
  152. ADFMG.PL=adm_fmmgrp.pl
  153. ADFAP.PL=adm_fmauxpost.pl
  154. ADEXPIRE.PL=expire.pl
  155. ADPERIODMAIL.PL=periodmail.pl
  156. ADMTEST.PL=test_adm.pl
  157.  
  158. PSCRIPTS=$(LIBWEBFORUM.PL) $(REGISTER.PL) 
  159. CSCRIPTS=$(WFCOMMAND.PL) $(TOP.PL) $(FORUM.PL) $(SUBJECT.PL)\
  160.      $(POST.PL) $(MKMSG.PL) $(CANCEL.PL) $(SMAIL.PL)
  161. ASCRIPTS=$(TESTCOMMAND.PL) $(ADMIN.PL) $(ADSHOWUSERS.PL)\
  162.      $(ADADDFORUM.PL) $(ADSNR.PL) $(ADUNR.PL) $(ADDLF.PL)\
  163.      $(ADSGRP.PL) $(ADAGRP.PL) $(ADDGRP.PL) $(ADAUS.PL)\
  164.      $(ADGMU.PL) $(ADDLU.PL) $(ADSFG.PL) $(ADGPU.PL)\
  165.      $(ADFPG.PL) $(ADFMG.PL) $(ADFAP.PL) $(ADEXPIRE.PL)\
  166.      $(ADPERIODMAIL.PL) $(ADMTEST.PL)
  167.  
  168. INDEX.HTML=index.html
  169. REGISTER.HTML=register.html
  170. TOP.HTML=top.html
  171. FORUM.HTML=forum.html
  172. SUBJECT.HTML=subject.html
  173. POST.HTML=post.html
  174. AKF.HTML=AKF.html
  175. ADMIN.HTML=admin.html
  176.  
  177. HTMLS=$(REGISTER.HTML) $(TOP.HTML) $(FORUM.HTML) $(SUBJECT.HTML)\
  178.       $(POST.HTML)
  179.  
  180. SpecialReg=$(AbsWFRoot)/$(REGISTER.HTML)
  181. SpecialIndex=$(AbsWFRoot)/$(INDEX.HTML)
  182. SpecialAKF=$(AbsWFRoot)/$(AKF.HTML)
  183. SpecialAdmin=$(AbsWFDbase)/$(ADMIN.HTML)
  184.  
  185. SpecialHTML= $(SpecialReg) $(SpecialIndex) $(SpecialAKF) $(SpecialAdmin)
  186.  
  187. PSCRIPTS_TGT=$(PSCRIPTS:%=$(AbsWFBin)/%)
  188. CSCRIPTS_TGT=$(CSCRIPTS:%=$(AbsWFCtrlBin)/%)
  189. ASCRIPTS_TGT=$(ASCRIPTS:%=$(AbsWFAdminBin)/%)
  190. HTMLS_TGT=$(HTMLS:%=$(AbsWFHtml)/%)
  191.  
  192. ############################################################
  193. # Access control
  194.  
  195. HTACCESS=.htaccess
  196. HTPASSWD=.htpasswd
  197. HTGROUP=.htgroup
  198.  
  199. PASSWDFile= $(AbsWFDbase)/$(HTPASSWD)
  200. GROUPFile= $(AbsWFDbase)/$(HTGROUP)
  201. AdminACCESSFiles= $(AbsWFDbase)/$(HTACCESS) $(AbsWFSpool)/$(HTACCESS)\
  202.           $(AbsWFAdminBin)/$(HTACCESS)
  203. MasterACCESSFile=$(AbsWFCtrlBin)/$(HTACCESS)
  204.  
  205. MkAccess=mkaccessfile
  206.  
  207. AccessControl=$(MkAccess) $(PASSWDFile) $(GROUPFile)\
  208.      $(AdminACCESSFiles) $(MasterACCESSFile)
  209.  
  210. ############################################################
  211. #
  212. # sed replacement scripts: used to customise the installation
  213. #    according to the Makefile configuration. Special strings
  214. #    in the scripts and HTML pages are automatically replaced
  215. #    by the values that they should point to. This is worked
  216. #    out here. The sed scripts contains the full list of
  217. #    such strings.
  218. #
  219.  
  220. DCsed='s^DATE^$(DATE)^g' \
  221.       's^CREATOR^$(CREATOR)^g'\
  222.       's^CREADDR^$(CREADDR)^g'\
  223.       's^SERVER_NAME^$(SERVER_NAME)^g'\
  224.       's^URLWFCOMPLETE^$(UrlWFComplete)^g'\
  225.       's^SENDMAIL^$(sendmail)^g'\
  226.       's^LOGLEVEL^$(LogLevel)^g'\
  227.       's^LOGFILE^$(LogFile)^g'\
  228.       's^MAILQUEUE^$(MAILQUEUE)^g'
  229.  
  230. DIRsed= 's^ABSWWWROOT^$(AbsWWWRoot)^g'\
  231.     's^ABSCGIBIN^$(AbsCGIBin)^g'\
  232.     's^ABSWFROOT^$(AbsWFRoot)^g'\
  233.     's^ABSWFCTRLBIN^$(AbsWFCtrlBin)^g'\
  234.     's^ABSWFADMINBIN^$(AbsWFAdminBin)^g'\
  235.     's^ABSWFBIN^$(AbsWFBin)^g'\
  236.     's^ABSWFDBASE^$(AbsWFDbase)^g'\
  237.     's^ABSWFSPOOL^$(AbsWFSpool)^g'\
  238.     's^ABSWFHTML^$(AbsWFHtml)^g'\
  239.     's^URLWFROOT^$(UrlWFRoot)^g'\
  240.     's^URLWFCTRLBIN^$(UrlWFCtrlBin)^g'\
  241.     's^URLWFADMINBIN^$(UrlWFAdminBin)^g'\
  242.     's^URLWFBIN^$(UrlWFBin)^g'\
  243.     's^URLWFBIN^$(UrlWFBin)^g'
  244.  
  245. ACCsed= 's^PASSWDFILE^$(PASSWDFile)^g'\
  246.     's^ACCESSFILE^$(HTACCESS)^g'\
  247.     's^GROUPFILE^$(GROUPFile)^g'
  248.  
  249. SCRIPTsed='s^LIBWEBFORUM.PL^$(LIBWEBFORUM.PL)^g'\
  250.     's^STD_REGISTER.PL^$(REGISTER.PL)^g'\
  251.     's^STD_WFCOMMAND.PL^$(WFCOMMAND.PL)^g'\
  252.     's^STD_TESTCOMMAND.PL^$(TESTCOMMAND.PL)^g'\
  253.     's^STD_TOP.PL^$(TOP.PL)^g'\
  254.     's^STD_FORUM.PL^$(FORUM.PL)^g'\
  255.     's^STD_SUBJECT.PL^$(SUBJECT.PL)^g'\
  256.     's^STD_MESSAGE.PL^$(MESSAGE.PL)^g'\
  257.     's^STD_SCRM.PL^$(SCRM.PL)^g'\
  258.      's^STD_POST.PL^$(POST.PL)^g'\
  259.      's^STD_MKMSG.PL^$(MKMSG.PL)^g'\
  260.      's^STD_CANCEL.PL^$(CANCEL.PL)^g'\
  261.      's^STD_SMAIL.PL^$(SMAIL.PL)^g'\
  262.      's^ADM_DOCOMMAND^$(ADMIN.PL)^g'\
  263.      's^ADM_SHOWUSERS.PL^$(ADSHOWUSERS.PL)^g'\
  264.      's^ADM_ADDFORUM.PL^$(ADADDFORUM.PL)^g'\
  265.      's^ADM_SHOWNREG.PL^$(ADSNR.PL)^g'\
  266.      's^ADM_UPDNR.PL^$(ADUNR.PL)^g'\
  267.      's^ADM_DELETEFORUM.PL^$(ADDLF.PL)^g'\
  268.      's^ADM_SHOWGROUPS.PL^$(ADSGRP.PL)^g'\
  269.      's^ADM_ADDGROUP.PL^$(ADAGRP.PL)^g'\
  270.      's^ADM_DELETEGROUP.PL^$(ADDGRP.PL)^g'\
  271.      's^ADM_ADDUSER.PL^$(ADAUS.PL)^g'\
  272.      's^ADM_DELETEUSER.PL^$(ADDLU.PL)^g'\
  273.      's^ADM_GROUPMU.PL^$(ADGMU.PL)^g'\
  274.      's^ADM_GROUPPU.PL^$(ADGPU.PL)^g'\
  275.      's^ADM_FORUMPG.PL^$(ADFPG.PL)^g'\
  276.      's^ADM_FORUMMG.PL^$(ADFMG.PL)^g'\
  277.      's^ADM_AUXPOST.PL^$(ADFAP.PL)^g'\
  278.      's^ADM_EXPIRE.PL^$(ADEXPIRE.PL)^g'\
  279.      's^ADM_PERIODMAIL.PL^$(ADPERIODMAIL.PL)^g'\
  280.      's^ADM_SHOWFORUMSGROUPS.PL^$(ADSFG.PL)^g'\
  281.     's^STD_DOCOMMAND^$(UrlWFCtrlBin)/$(WFCOMMAND.PL)^g'
  282.  
  283. HTMLsed='s^INDEX.HTML^$(INDEX.HTML)^g'\
  284.     's^TOP.HTML^$(TOP.HTML)^g'\
  285.     's^FORUM.HTML^$(FORUM.HTML)^g'\
  286.     's^SUBJECT.HTML^$(SUBJECT.HTML)^g'\
  287.     's^MESSAGE.HTML^$(MESSAGE.HTML)^g'\
  288.      's^POST.HTML^$(POST.HTML)^g'\
  289.     's^AKF.HTML^$(AKF.HTML)^g'\
  290.     's^ADMIN.HTML^$(ADMIN.HTML)^g'\
  291.     's^REGISTER.HTML^$(REGISTER.HTML)^g'
  292.  
  293. ALLsed=$(DCsed) $(DIRsed) $(HTMLsed) $(SCRIPTsed) $(ACCsed)
  294. SEDSCRIPTS=sedscripts
  295.  
  296. ############################################################
  297. # the makeable dependencies
  298.  
  299. .SILENT:
  300.  
  301. WebForum=$(Directories) $(AccessControl)\
  302.     $(SEDSCRIPTS)                \
  303.     $(HTMLS_TGT)                \
  304.     $(PSCRIPTS_TGT)                \
  305.     $(CSCRIPTS_TGT)                \
  306.     $(ASCRIPTS_TGT)                \
  307.     $(SpecialHTML)
  308.  
  309. all: $(WebForum)
  310.     echo "Made $(WebForumBase)..."
  311.  
  312. uninstall:
  313.     echo "Uninstalling $(WebForumBase)"
  314.     (cd $(AbsWWWRoot);\
  315.       rm -rf $(AbsWFRoot))
  316.     (cd $(AbsCGIBin);\
  317.       rm -rf $(AbsWFBin))
  318.  
  319. clean: uninstall
  320.     rm $(MkAccess)
  321.  
  322. ############################################################
  323. # Directory dependencies
  324.  
  325. $(AbsWFBin): $(AbsCGIBin)
  326.     echo "Making $@"
  327.     mkdir $@
  328. $(AbsWFCtrlBin): $(AbsWFBin)
  329.     echo "Making $@"
  330.     mkdir $@
  331. $(AbsWFAdminBin): $(AbsWFBin)
  332.     echo "Making $@"
  333.     mkdir $@
  334.  
  335. $(AbsWFRoot): $(AbsWWWRoot)
  336.     echo "Making $@"
  337.     (umask 000;\
  338.      mkdir $@)
  339. $(AbsWFDbase): $(AbsWFRoot)
  340.     echo "Making $@"
  341.     (umask 000;\
  342.      mkdir $@)
  343.  
  344. $(AbsWFDbase)/guest: $(AbsWFRoot) dbase/guest
  345.      echo "Making $@"
  346.      cp dbase/guest $@
  347.      chmod a+w $@
  348.  
  349. $(AbsWFDbase)/wfroot: $(AbsWFRoot) dbase/wfroot
  350.     echo "Making $@"
  351.      $(sed) -f $(SEDSCRIPTS) dbase/wfroot > $@
  352.      chmod a+w $@
  353.  
  354. $(AbsWFSpool): $(AbsWFRoot)
  355.     echo "Making $@"
  356.     (umask 000;\
  357.      mkdir $@)
  358. $(AbsWFHtml): $(AbsWFRoot)
  359.     echo "Making $@"
  360.     (umask 000;\
  361.      mkdir $@)
  362.  
  363. ############################################################
  364. # Access Control
  365.  
  366. $(PASSWDFile): $(AbsWFDbase)
  367.     echo "Making $@"
  368.     echo "wfroot:wfYnaoT7ej6kw" >$(PASSWDFile)
  369.     echo "guest:guVeRgi5kAY4k" >>$(PASSWDFile)
  370.  
  371. $(GROUPFile): $(AbsWFDbase)
  372.     echo "Making $@"
  373.     echo "webmasters:wfroot" >$(GROUPFile)
  374.     echo "webforum:guest" >>$(GROUPFile)
  375.  
  376. $(AdminACCESSFiles): $${@:%/$(HTACCESS)=%} $(MkAccess)
  377.     echo "Making $@"
  378.     $(MkAccess) $@ $(PASSWDFile) $(GROUPFile)
  379.     
  380. $(MasterACCESSFile): $${@:%/$(HTACCESS)=%} $(MkAccess)
  381.     echo "Making $@"
  382.     $(MkAccess) $@ $(PASSWDFile) $(GROUPFile) all
  383.     
  384. $(MkAccess): src/mkaccess.pl
  385.     echo "Making $@"
  386.     echo "#!$(Perl)" >$(MkAccess)
  387.     $(sed) -e 's/DATE/$(DATE)/g' src/mkaccess.pl >>$(MkAccess)
  388.     chmod a+x $(MkAccess)
  389.  
  390. ############################################################
  391. # scripts and htmls
  392.  
  393. $(SEDSCRIPTS): src/* html/*
  394.     echo "Making $@"
  395.     echo $(ALLsed) > $(SEDSCRIPTS).tmp
  396.     $(Perl) -ne 's/\^g/^g\n/g;print;' <$(SEDSCRIPTS).tmp >$(SEDSCRIPTS)
  397.     rm $(SEDSCRIPTS).tmp
  398.  
  399. $(AbsWFHtml)/% : html/%
  400.     echo "Making $@"
  401.     $(sed) -f $(SEDSCRIPTS) $< > $@
  402.  
  403. $(AbsWFBin)/% : src/%
  404.     echo "Making $@"
  405.     echo "#!$(Perl)" > $@
  406.     $(sed) -f $(SEDSCRIPTS) $< >> $@
  407.     chmod a+x $@
  408.  
  409. $(AbsWFCtrlBin)/% : src/%
  410.     echo "Making $@"
  411.     echo "#!$(Perl)" > $@
  412.     $(sed) -f $(SEDSCRIPTS) $< >> $@
  413.     chmod a+x $@
  414.  
  415. $(AbsWFAdminBin)/% : src/%
  416.     echo "Making $@"
  417.     echo "#!$(Perl)" > $@
  418.     $(sed) -f $(SEDSCRIPTS) $< >> $@
  419.     chmod a+x $@
  420.  
  421. ############################################################
  422. # Special files that need individual treatment
  423.  
  424. $(SpecialReg): html/$(REGISTER.HTML)
  425.     echo "Making $@"
  426.     $(sed) -f $(SEDSCRIPTS)\
  427.            -e 's^UID^^g'\
  428.            -e 's^PASSWD^^g'\
  429.            -e 's^VFY^^g'\
  430.            -e 's^RNAME^^g'\
  431.            -e 's^EMAIL^^g'\
  432.            -e 's^HURL^^g'\
  433.         $? > $@
  434.  
  435. $(SpecialIndex): html/$(INDEX.HTML)
  436.     echo "Making $@"
  437.     $(sed) -f $(SEDSCRIPTS)    $? > $@
  438.  
  439. $(SpecialAKF): html/$(AKF.HTML)
  440.     echo "Making $@"
  441.     $(sed) -f $(SEDSCRIPTS)    $? > $@
  442.  
  443. $(SpecialAdmin): html/$(ADMIN.HTML)
  444.     echo "Making $@"
  445.     $(sed) -f $(SEDSCRIPTS) $? > $(AbsWFDbase)/admin.html
  446.